package com.nuoniu.sibanyun.service.expenses;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nuoniu.sibanyun.entity.crm.CrmGoodsOrder;
import com.nuoniu.sibanyun.entity.expenses.ExpensesAccount;
import com.nuoniu.sibanyun.entity.expenses.ExpensesBusinessOrder;
import com.nuoniu.sibanyun.entity.expenses.ExpensesPaymentOrder;
import com.nuoniu.sibanyun.entity.expenses.dto.ExpensesAccountSearchDto;

import java.math.BigDecimal;

/**
 * <p>
 * 费用中心-账户管理 服务类
 * </p>
 *
 * @author 小啊刚
 * @since 2022-05-06
 */
public interface IExpensesAccountService extends IService<ExpensesAccount> {

    /**
     * 初始化 账户
     * @param companyId
     */
    void initExpensesAccount(Integer companyId);
    /**
     * 获取 账户
     * @return
     */
    ExpensesAccount getByCompany(Integer companyId);

    /**
     *
     * @param accountSearchDto
     * @return
     */
    Page<ExpensesAccount> pageList(ExpensesAccountSearchDto accountSearchDto);


    /**
     * 处理业务订单(废弃 202220525)
     * @param businessOrder
     */
    void changeFromBusinessOrder(ExpensesBusinessOrder businessOrder);

    /**
     * 处理 商品订单
     * @param crmGoodsOrder
     */
    void changeFromCrmGoodsOrder(CrmGoodsOrder crmGoodsOrder);

    /**
     * 处理 支付订单
     * @param expensesPaymentOrder
     */
    void changeFromPaymentOrder(ExpensesPaymentOrder expensesPaymentOrder);

    /**
     * 缴纳保证金（如果deposit为null,则补充保证金到1000）
     * @param deposit
     */
    void addDeposit(BigDecimal deposit);

    /**
     * 扣除保证金（保证金可为负）
     * @param deposit
     * @param companyId
     */
    void deductionDeposit(Integer companyId, BigDecimal deposit);


}
